package cn.zhangyong.opengl20learn

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import cn.zhangyong.opengl20learn.baselearn1.BaseLearnActivity
import cn.zhangyong.opengl20learn.baselearn2matrix.BaseLearnMatrixActivity
import cn.zhangyong.opengl20learn.baselearn3rotate.BaseLearnMatrixRotateActivity
import cn.zhangyong.opengl20learn.baselearn4colorful.BaseLearnMatrixRotateColorfulActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        btn_base1.setOnClickListener {
            //因为手机屏幕不是正方形，所以基本的图形会发生形变
            startActivity(Intent(this, BaseLearnActivity::class.java))
        }
        btn_base2.setOnClickListener {
            //使用matrix使图形不发生形变
            startActivity(Intent(this, BaseLearnMatrixActivity::class.java))
        }
        btn_base3.setOnClickListener {
            //使用matrix使图形不发生形变,增加旋转动作
            startActivity(Intent(this, BaseLearnMatrixRotateActivity::class.java))
        }
        btn_base4.setOnClickListener {
            //使用matrix使图形不发生形变,增加旋转动作,变成彩色
            startActivity(Intent(this, BaseLearnMatrixRotateColorfulActivity::class.java))
        }
    }
}
